package com.steakliu.sun.common.thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 功能说明： 流控线程池
 * <p>
 * Original @Author: steakliu-刘牌, 2023-01-31  22:46
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
public class FlowControlPostProcessorThreadPool {

    private static final ExecutorService executorService = new ThreadPoolExecutor(8,
            Runtime.getRuntime().availableProcessors() * 2,
            10000,
            TimeUnit.MILLISECONDS,
            new ArrayBlockingQueue<>(10000));


    public static void submit(Runnable runnable){
        executorService.submit(runnable);
    }
}
